﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="getip.aspx.cs" Inherits="getip" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Panel ID="Panel1" runat="server"></asp:Panel>
   
   <div>Dynamically Add Contrl in Treeview</div>
   <asp:TreeView ID="myTreeView" runat="server" ImageSet="Arrows" PathSeparator="|" ShowCheckBoxes="Leaf">

<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
 

<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px"      VerticalPadding="0px" />
 
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"      NodeSpacing="0px" VerticalPadding="0px" />
 
</asp:TreeView>

<asp:Button ID="cmdCheckSelectNode" runat="server" Text="Nodes Selected" /><br /><br />

<asp:Label ID="lblShowMessage" runat="server" />  
     </div>
     
     test
     
     <asp:TextBox ID="txtWWW" runat="server">
     
     </asp:TextBox>
     <asp:Button ID="btnS" runat="server" Text="Submit" OnClientClick='return validateControls()'/>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript">

function validateControls()
{
alert("hi");
  if(document.getElementById("<%=txtWWW.ClientID %>").value=="")
    {
               alert("Web URL can not be blank");
               document.getElementById("<%=txtWWW.ClientID %>").value="http://"
               document.getElementById("<%=txtWWW.ClientID %>").focus();
               return false;
    }
    var Url="^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$"
    var tempURL=document.getElementById("<%=txtWWW.ClientID%>").value;
    var matchURL=tempURL.match(Url);
     if(matchURL==null)
     {
               alert("Web URL does not look valid");
               document.getElementById("<%=txtWWW.ClientID %>").focus();
               return false;
     }
     return true;
     }
</script>